package com.sl.biz.modular.std.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sl.biz.modular.std.dao.domain.entity.StandardFieldConfigDO;
import com.sl.biz.modular.std.service.StandardFieldConfigBizService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/standard/field")
@RequiredArgsConstructor
public class StandardFieldConfigController {

    private final StandardFieldConfigBizService standardFieldConfigBizService;

    @Operation(summary = "分页查询")
    @GetMapping("/page")
    public Page<StandardFieldConfigDO> page() {
        return standardFieldConfigBizService.page();
    }


    @Operation(summary = "新增")
    @PostMapping("/add")
    public Boolean add(@RequestBody StandardFieldConfigDO standardFieldConfigDO) {
        return standardFieldConfigBizService.add(standardFieldConfigDO);
    }

    @Operation(summary = "修改")
    @PostMapping("/update_by_id")
    public Boolean updateById(@RequestBody StandardFieldConfigDO standardFieldConfigDO) {
        return standardFieldConfigBizService.updateById(standardFieldConfigDO);
    }

    @Operation(summary = "删除")
    @PostMapping("/remove_by_id")
    public Boolean removeById(@RequestBody StandardFieldConfigDO standardFieldConfigDO) {
        return standardFieldConfigBizService.removeById(standardFieldConfigDO);
    }
}
